﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using LiveNet.Silverlight;
using LiveNet.Photos;
using LiveNet.Authentication;


namespace LiveNetSample
{
    class Program
    {
        static void Main(string[] args)
        {
            string email = "livenet@live.co.uk";
            string token = RpsAuthentication.GetToken(email, "lukeandscott20");
            string name = "TestAlbumName";

            LivePhotos spaces = new LivePhotos(email, token, AuthenticationToken.RelyingPartySuite);
            //Album[] albums = spaces.ListAlbums();
            Album m_album = spaces.GetAlbum(name);
            Console.WriteLine(m_album.Name);
            Console.WriteLine(string.Format("Url: {0}", m_album.AlbumUrl.ToString()));

            //foreach (Album a in albums)
            //{
            //    Console.WriteLine(a.Name);
            //}

            //LiveMedia livemedia = new LiveMedia("40829", "6a8a2d8f16c0d496645e8a5420318daa");

            ////MediaFileSet[] sets = livemedia.ListFileSets();

            ////foreach (MediaFileSet set in sets)
            ////{

            ////    Console.WriteLine(set.Name);

            ////}

            //MediaFileSet set = livemedia.GetFileSet("Angus1");
            ////MediaFileSet set = livemedia.AddFileSet(@"d:\downloads\LiveSideAngusDannyInterview.zip", "Angus2");
            //if (set != null)
            //{
            //    foreach (MediaFile file in set.Files)
            //    {
            //        Stream s = file.GetFileStream();
            //        Console.WriteLine(string.Format("{0} is something bytes long.", file.FileName));
            //    }
            //}

            ////Console.WriteLine(set.Name);
            ////Console.WriteLine(set.IFrameCode);

            Console.ReadLine();
        }
    }
}
